<!doctype html>
<html>
<head>
  <title>Learning javascript</title>
  <meta charset="utf-8" />
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <style>
  </style>
</head>
<body>
<div>
  <p>What is the weather?</p>
  <input id="answer"></input>
  <button id="myButton">submit</button>
  <script type="text/javascript"> 
    // alert(Math.pow(5,3));
    
    document.getElementById("myButton").onclick=function() {
      var x=Math.random();
      x=5*x;
      x=Math.floor(x);
      
      if (x==document.getElementById("answer").value) {
        alert("That's correct!");
      }
      else {
        alert("That's wrong, my number was " + x);
      }
    }
    
  </script>
</div>
</body>
</html>
